/**
 * First we will load all of this project's JavaScript dependencies which
 * includes Vue and other libraries. It is a great starting point when
 * building robust, powerful web applications using Vue and Laravel.
 */
require('./bootstrap');
window.Vue = require('vue');

//vue resource&vue router
// require('vue-resource');
import VueRouter from 'vue-router';
Vue.use(VueRouter);

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';//import 'element-ui/lib/theme-default/index.css'
Vue.use(ElementUI);


import {ModelListSelect} from 'vue-search-select';
Vue.component('model-list-select',ModelListSelect);


/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */
var home=Vue.component('home', require('./components/Home.vue'));
var dorm=Vue.component('dorm', require('./components/Dorm.vue'));
var dorm_list=Vue.component('dorm_list', require('./components/DormList.vue'));
var dorm_arrange=Vue.component('dorm_arrange', require('./components/DormArrange.vue'));
var dorm_building=Vue.component('dorm_building', require('./components/DormBuilding.vue'));
var dorm_meter=Vue.component('dorm_meter', require('./components/DormMeter.vue'));

var staff=Vue.component('staff', require('./components/Staff.vue'));
var staff_department=Vue.component('staff_department', require('./components/StaffDepartment.vue'));
var staff_list=Vue.component('staff_list', require('./components/StaffList.vue'));
var staff_move=Vue.component('staff_move', require('./components/StaffMove.vue'));

var fee=Vue.component('fee', require('./components/Fee.vue'));
var fee_list=Vue.component('fee_list', require('./components/FeeList.vue'));
var fee_period=Vue.component('fee_period', require('./components/FeePeriod.vue'));

const routerObj = new VueRouter(
    {
        routes: [
            {path:'/dorm_building',component:dorm_building},
            {path:'/dorm_list/:building_id',component:dorm_list,props:true,children:[
                {path:'dorm_arrange/:dorm_id',component:dorm_arrange,props:true},
                {path:'dorm_meter/:dorm_id',component:dorm_meter,props:true}
            ]},
            {path:'/staff_department',component:staff_department},
            {path:'/staff_list/:department_id',component:staff_list,props:true,children:[
                {path:'staff_move/:staff_id',component:staff_move,props:true}
            ]},
            {path:'/fee_period',component:fee_period},
            {path:'/fee_list/:period_id',component:fee_list,props:true}
        ]
    }
);

const app = new Vue({
    el: '#app',
    data: {
    },
    created() {
    },
    methods: {
        func(){
            console.log(this);
            this.$notify.success({message:'func was call'});
        }
    },
    router:routerObj,
});


